from flask import Flask
from .authenticate import jwt_authenticate
from .log import logger_handle
from .throttle import RateThrottle


def register_middleware(app: Flask):
    register_before_request(app)
    register_after_request(app)


def register_before_request(app: Flask):
    app.before_request(jwt_authenticate)
    app.before_request(logger_handle)
    app.before_request(RateThrottle.rate_throttle_middleware)


def register_after_request(app: Flask):
    ...
